// @ts-ignore
/* eslint-disable */
import {
  UserParams,
  UserResult,
  UserResultDetails,
  UserResultItem,
} from '@/services/api/model/usersModel';
/* 用户相关 */
import { request } from '@umijs/max';
/** 获取用户 GET  */
export async function getUserList(data: API.AreasParams, options?: { [key: string]: any }) {
  return request<UserResult>(AUTH_URL + '/user/list', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

export async function getList(params?: UserParams, options?: { [key: string]: any }) {
  return request<UserResult>(AUTH_URL + '/superlink/api/areas/v2/areas', {
    method: 'GET',
    params,
    ...(options || {}),
  });
}
export async function delItem(params: { userIds: number }) {
  return request(AUTH_URL + '/user/delete', {
    method: 'DELETE',
    params,
  });
}

export async function createItem(data: UserResultItem) {
  return request(AUTH_URL + '/user/create', {
    method: 'POST',
    data,
  });
}
export async function updateItem(data: UserResultItem) {
  return request(AUTH_URL + '/user/update', {
    method: 'PUT',
    data,
  });
}

export async function getItemDetails(params: { userId: number }) {
  return request<UserResultDetails>(AUTH_URL + '/user/get', {
    method: 'GET',
    params,
  });
}
